﻿using Grow.Db.Entity;
using Grow.EventBus.Cap.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Grow.EventBus.Cap.PublisherEventData
{
    /// <summary>
    /// 消息表
    /// </summary>
    public class PublisherEventDataEntity : EntityBase
    {
        public PublisherEventDataEntity(Guid id, string environmentName, string eventName, string eventBody, string eventHeads, EventDataStatusEnum eventDataStatus, int retryCount, DateTimeOffset sendAt, DateTimeOffset? delayAt, DateTimeOffset? lockEndTime, DateTimeOffset? expireTime)
           : base(id)
        {
            EnvironmentName = environmentName;
            EventName = eventName;
            EventBody = eventBody;
            EventHeads = eventHeads;
            EventDataStatus = eventDataStatus;
            RetryCount = retryCount;
            SendAt = sendAt;
            DelayAt = delayAt;
            LockEndTime = lockEndTime;
            ExpireTime = expireTime;
        }
        /// <summary>
        /// 主机
        /// </summary>
        public string EnvironmentName { get; set; }
        /// <summary>
        /// 事件名称
        /// </summary>
        public string EventName { get; set; }

        /// <summary>
        /// 事件内容
        /// </summary>
        public string EventBody { get; set; }

        /// <summary>
        /// 事件附加数据
        /// </summary>
        public string EventHeads { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public EventDataStatusEnum EventDataStatus { get; set; }

        /// <summary>
        /// 已重试次数
        /// </summary>
        public int RetryCount { get; set; }

        /// <summary>
        /// 锁定结束时间
        /// </summary>
        public DateTimeOffset SendAt { get; set; }

        /// <summary>
        /// 延迟消费时间
        /// </summary>
        public DateTimeOffset? DelayAt { get; set; }
        /// <summary>
        /// 锁定结束时间
        /// </summary>
        public DateTimeOffset? LockEndTime { get; set; }

        /// <summary>
        /// 过期时间
        /// </summary>
        public DateTimeOffset? ExpireTime { get; set; }


    }
}
